<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
$month = date('n',time());
switch ($month) {
	case 2:
	case 3:
	case 4:
		$fuzhuangkeyword = '春装';
		break;
	case 5:
	case 6:
	case 7:
		$fuzhuangkeyword = '夏装';
		break;
	case 8:
	case 9:
	case 10:
		$fuzhuangkeyword = '秋装';
		break;
	case 1:
	case 11:
	case 12:
		$fuzhuangkeyword = '羽绒服';
		break;
}
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'即美说商城',
	'language' => 'zh_cn',
	'sourceLanguage' => 'zh_cn',
	'timeZone' => 'Asia/Shanghai',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),

	//application modules
    	'modules'=>array(
		// uncomment the following to enable the Gii tool

		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'sa',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),

	),
	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		
		'widgetFactory'=>array(
			'widgets'=>array(
				'CLinkPager'=>array(
					'header'=>'',
					'firstPageLabel' => '首页',
					'lastPageLabel' => '末页',
					'prevPageLabel' => '上一页',
					'nextPageLabel' => '下一页',
					'pageSize'=>25,
				),
			),
		),
		// uncomment the following to enable URLs in path-format
		'urlManager'=>array(
			'urlFormat'=>'path',
			'showScriptName' => false,
			'urlSuffix'=>'.html',
			
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
                        
		),
 


		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=dedecmsv57gbk',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '789852',
			'charset' => 'utf8',
			'schemaCachingDuration'=>864000,
		),

		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				 array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this for taobao open api
        'taoapp'=>array(
            'appSecret' => 'd6db526928e40be4e5f88e9ac281b366',
            'tbapicfg'	=> array(
                'v'				=> '2.0',
                'app_key'		=> '12201876',
                'format'		=> 'json',
                'sign_method'	=> 'HmacMD5',
                'page_size'		=> 39,
                'nick'			=> 'miyifun',
                'timestamp'		=> time(),
            ),
         ),
		'hotcates' => require(dirname(__FILE__).'/hotcates.php'),
		'hotkeywords' => require(dirname(__FILE__).'/hotkeywords.php'),
		'jianfei' => require(dirname(__FILE__).'/jianfei.php'),
		'defaultkw' => '减肥',
		'salt' => 'miyifun',
		'fuzhuangkw' =>$fuzhuangkeyword,
		'tmallurl' =>'http://s.click.taobao.com/t_9?p=mm_16992741_0_0&l=http%3A%2F%2Fwww.tmall.com%2F',
	),
);